package com.scuec.groupfive.controller;

import com.scuec.groupfive.service.UserDetailService;
import com.scuec.groupfive.vo.UserDetailVO;
import org.springframework.web.bind.annotation.*;

@RestController
@ResponseBody
@RequestMapping("/api/users")
@CrossOrigin
public class UserDetailController {


    private final UserDetailService userDetailService;

    public UserDetailController(UserDetailService userDetailService) {
        this.userDetailService = userDetailService;
    }

    @GetMapping("/detail/{userId}")

    public UserDetailVO getUserDetail(@PathVariable Long userId) {
        return userDetailService.getUserDetail(userId);
    }
}
